<?php
/**
 * aheadWorks Co.
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://ecommerce.aheadworks.com/LICENSE-M1.txt
 *
 * @category   AW
 * @package    AW_AdvancedReviews
 * @copyright  Copyright (c) 2009-2011 aheadWorks Co. (http://www.aheadworks.com)
 * @license    http://ecommerce.aheadworks.com/LICENSE-M1.txt
 */
?>

<?php
$dSort = Mage::helper('advancedreviews')->confOrderingItemsArray();
$dSort = reset($dSort);
$dSort = $dSort['value'];
?>
<div id="customer-reviews" class="box-collateral box-reviews">
<input type="hidden" id="filteredReviews-product" value="<?php echo $this->getRequest()->getParam('id');?>">
<input type="hidden" id="filteredReviews-customer" value="<?php echo $this->getRequest()->getParam('customerId');?>">
<input type="hidden" id="filteredReviews-ids">
<input type="hidden" id="filteredReviews-pagelimit" value="10">
<input type="hidden" id="filteredReviews-page" value="1">
<input type="hidden" id="filteredReviews-type" value="<?php echo $dSort?>">
<input type="hidden" id="filteredReviews-dir" value="DESC">

<script type="text/javascript">
    var getFilteredAction = '<?php echo $this->getFilteredAction()?>';
    var getUpdatePagerAction = '<?php echo $this->getUpdatePagerAction()?>';
    var getFilteredReviewsAction = '<?php echo $this->getFilteredReviewsAction()?>';
    //document.observe("dom:loaded", function() {getFiltered();});
</script>

		<div class="head">
            <h2 id="customer-reviews-header" class="title"><?php echo $this->__('Customer Reviews') ?></h2>
		</div>
      <div class="write-reviews">  <span>
&nbsp;Grab this item,&nbsp;
<a <?php if(Mage::getSingleton('customer/session')->isLoggedIn() || Mage::helper('review')->getIsGuestAllowToWrite()):?> href="javascript:void(0)" onclick="$('review-form-block').show();window.location.href='#review-form-block';return false;" <?php else:?> target="_blank" href="<?php echo Mage::getUrl('customer/account/login/', array(
                    Mage_Customer_Helper_Data::REFERER_QUERY_PARAM_NAME => Mage::helper('core')->urlEncode(
                        Mage::getUrl('*/*/*', array('_current' => true)) .
                        '#review-form')
                    )
                )?>" <?php endif;?> >
<?php echo $this->__('Write a Review'); ?></a> , 
<a <?php if(Mage::helper('imagetest')->canUpload()):?> href="javascript:void(0)" onclick="$('image-uploadform-block').show();$('image-uploadform-content').show();window.location.href='#image-uploadform-block';return false;" <?php else:?> target="_blank" href="<?php echo $this->getUrl('customer/account/login')?>" <?php endif;?> >
<?php echo $this->__('Post Image'); ?></a> , 
<a <?php if(Mage::helper('vidtest')->canUpload()):?> href="javascript:void(0)" onclick="$('video-uploadform-block').show();$('uploadform-content').show();window.location.href='#video-uploadform-block';return false;" <?php else:?> target="_blank" href="<?php echo $this->getUrl('customer/account/login')?>" <?php endif;?> >
<?php echo $this->__('Post Video'); ?></a> 
</span>   </div>
   
<?php echo $this->getChildHtml('advancedreviews_summary_reviews') ?>
    <?php echo $this->getChildHtml('advancedreviews_ajax-content-filter') ?>
  	<div id="review-form-block" style="display:none"><?php echo $this->getChildHtml('review_form') ?></div>
	<?php echo $this->getChildHtml('advancedreviews_login') ?>
	<?php echo $this->getChildHtml('advancedreviews_needbuy') ?>

</div>
